package com.liangzhong.modules.chat.command
{
	import com.liangzhong.proxy.chat.ChatProxy;
	import com.liangzhong.proxyconstant.chat.ChatProxyConstant;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class ChatCommand extends SimpleCommand
	{
		public function ChatCommand()
		{
			super();
		}
		override public function execute(notification:INotification):void
		{
			switch(notification.getName())
			{
				case ChatProxyConstant.CHAT_MEDIATOR_NOTIFICATION:
					mediatorNotification(notification);
					break;
			}
		}
		/**
		 * Mediator -->clubCommand 通知
		 * @param notification
		 * 
		 */		
		private function mediatorNotification(notification:INotification):void
		{
			var proxy:ChatProxy = facade.retrieveProxy(ChatProxy.PROXYNAME) as ChatProxy;
			switch(notification.getType())
			{
				case ChatProxyConstant.SEND_MESSAGE://发送消息
					proxy.requestSendMessage(notification.getBody());
					break;
				
			}
		}
	}
}